package com.cdtye.itps.cms.dao.line.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.*;
import com.cdtye.common.webcore.util.DateUtil;
import com.cdtye.itps.cms.dao.enums.DelFlagEnum;
import com.cdtye.itps.models.base.model.attr.basic.LineAttr;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * ????
 * @author
 * @date 2021-12-21
 */
@ApiModel("局线路")
@Data
@Accessors(chain = true)
@TableName("JC_SECLINE")
public class DelectJcSecline{
    @ApiModelProperty(value = "线路ID")
    @TableId(value = "SECLINE_ID", type = IdType.ASSIGN_UUID)
    private String seclineId;

    @ApiModelProperty(value = "资产所属单位")
    private String assetDept;

    @ApiModelProperty(value = "开始公里标")
    private Double beginRoad;

    @ApiModelProperty(value = "终点")
    private String endAddress;

    @ApiModelProperty(value = "结束公里标")
    private Double endRoad;

    @ApiModelProperty(value = "线路ID")
    private String lineId;

    @ApiModelProperty(value = "线路等级  字典100033")
    private String lineLevel;

    @ApiModelProperty(value = "备注信息")
    private String memo;

    @ApiModelProperty(value = "电化开通时间")
    @DateTimeFormat(pattern = DateUtil.DATETIME_FORMAT)
    @JSONField(format = DateUtil.DATETIME_FORMAT)
    private Date openDate;

    @ApiModelProperty(value = "运营里程")
    private Double operateKilomeaters;

    @ApiModelProperty(value = "线路名称")
    private String seclineName;

    @ApiModelProperty(value = "线路编号")
    private String seclineNo;

    @ApiModelProperty(value = "段辖线路类别    GX :干线  ZX:之线    QX :曲线")
    private String seclineType;

    @ApiModelProperty(value = "速度等级 字典100030 ")
    private String speedLevel;

    @ApiModelProperty(value = "起点")
    private String startAddress;

    @ApiModelProperty(value = "供电方式 字典100032")
    private String supplyWay;

    @ApiModelProperty(value = "悬挂类型  字典100031")
    private String suspensionType;

    @ApiModelProperty(value = "排序号")
    private Double orderNum;

    @ApiModelProperty(value = "供电处综合系统线路ID")
    private String gdxtLineId;

    @ApiModelProperty(value = "共享数据中心编码")
    private String mCode;

    @ApiModelProperty(value = "来源")
    private String source;

    @ApiModelProperty(value = "线路类型 GT PT")
    private String railType;

    @ApiModelProperty(value = "来源ID")
    private String sourceId;

    @ApiModelProperty(value = "线路类别 GX：干线")
    private String category;

    @ApiModelProperty(value = "换算条公里")
    private String convertLineKms;

    @ApiModelProperty("创建时间")
    @TableField(value ="CREATE_DATETIME", fill = FieldFill.INSERT)
    private Date createDatetime;

    @ApiModelProperty("更新时间")
    @TableField(value ="UPDATE_DATETIME",fill = FieldFill.INSERT_UPDATE)
    private Date updateDatetime;

    @ApiModelProperty("创建人")
    @TableField(value ="CREATE_BY", fill = FieldFill.INSERT)
    private String createBy;

    @ApiModelProperty("更新人")
    @TableField(value ="UPDATE_BY",fill = FieldFill.INSERT_UPDATE)
    private String updateBy;

    @ApiModelProperty(value = "逻辑删除")
    @TableField(value ="DEL_FLAG", fill = FieldFill.INSERT)
    private String delFlag;

    public LineAttr getLineAttr(){
        LineAttr lineAttr = new LineAttr();
        lineAttr.setLineId(this.seclineId);
        lineAttr.setLineType(this.seclineType);
        lineAttr.setRailType(this.railType);
        lineAttr.setLineCode(this.seclineNo);
        lineAttr.setOperateKil(this.operateKilomeaters);
        return lineAttr;
    }
}
